/*    */ package com.zimbra.cs.mailclient.imap;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import java.util.Map.Entry;
/*    */ import java.util.TreeMap;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class IDInfo
/*    */ {
/*    */   public static final String NAME = "name";
/*    */   public static final String VERSION = "version";
/*    */   public static final String OS = "os";
/*    */   public static final String OS_VERSION = "os-version";
/*    */   public static final String VENDOR = "vendor";
/*    */   public static final String SUPPORT_URL = "support-url";
/*    */   public static final String ADDRESS = "address";
/*    */   public static final String DATE = "date";
/*    */   public static final String COMMAND = "command";
/*    */   public static final String ARGUMENTS = "arguments";
/*    */   public static final String ENVIRONMENT = "environment";
/*    */   public static final String X_ORIGINATING_IP = "X-ORIGINATING-IP";
/*    */   public static final String X_VIA = "X-VIA";
/* 45 */   public static String DATASOURCE_IMAP_CLIENT_NAME = "ZimbraImapDataSource";
/*    */   
/* 47 */   private final Map<String, String> fields = new TreeMap(String.CASE_INSENSITIVE_ORDER);
/*    */   
/*    */   public static IDInfo read(ImapInputStream is) throws IOException {
/* 50 */     is.skipSpaces();
/* 51 */     IDInfo info = new IDInfo();
/* 52 */     if (!is.match('(')) {
/* 53 */       is.skipNil();
/* 54 */       return info;
/*    */     }
/* 56 */     while (!is.match(')')) {
/* 57 */       String name = is.readString();
/* 58 */       is.skipChar(' ');
/* 59 */       String value = is.readNString();
/* 60 */       info.fields.put(name, value);
/* 61 */       is.skipSpaces();
/*    */     }
/* 63 */     return info;
/*    */   }
/*    */   
/*    */   public String get(String key) {
/* 67 */     return (String)this.fields.get(key);
/*    */   }
/*    */   
/*    */   public String put(String key, String value) {
/* 71 */     return (String)this.fields.put(key, value);
/*    */   }
/*    */   
/*    */   public List<ImapData> toRequestParam() {
/* 75 */     List<ImapData> data = new ArrayList(this.fields.size());
/* 76 */     for (Map.Entry<String, String> e : this.fields.entrySet()) {
/* 77 */       data.add(ImapData.asString((String)e.getKey()));
/* 78 */       data.add(ImapData.asNString((String)e.getValue()));
/*    */     }
/* 80 */     return data;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mailclient/imap/IDInfo.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */